package com.sptus.web.config;

import com.sptus.system.domain.ConfigInfo;
import com.sptus.system.domain.DevDictionaries;
import com.sptus.system.domain.vo.AppDataVo;
import com.sptus.system.domain.vo.DevSetVo;
import com.sptus.system.service.IConfigInfoService;
import com.sptus.web.service.ISptUserRoleService;
import com.sptus.web.util.DevSqlUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.StringUtils;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

@Configuration
public class DataLoaderConfig {

    @Autowired
    IConfigInfoService configInfoService;


    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Autowired
    private ISptUserRoleService sptUserRoleService;


    ArrayList<String> roleCode=new ArrayList<>();



    // 全局变量
    private static Map<String, String> globalData;


    public static ArrayList<DevDictionaries> devDictionaries = new ArrayList<>();
    public static ArrayList<DevDictionaries> devDictionariesOld = new ArrayList<>();

    public static void loadData(IConfigInfoService configInfoService) {
        List<ConfigInfo> configInfos = configInfoService.getBaseMapper().selectList(null);
        Map<String, String> collect = configInfos.stream().collect(Collectors.toMap(ConfigInfo::getName, ConfigInfo::getValue));
        globalData = collect;
    }

    @PostConstruct
    private void init() {
        roleCode.add("admin");
        roleCode.add("install_role");
        List<ConfigInfo> configInfos = configInfoService.getBaseMapper().selectList(null);
        Map<String, String> collect = configInfos.stream().collect(Collectors.toMap(ConfigInfo::getName, ConfigInfo::getValue));
        globalData = collect;
        ArrayList<HashMap<String, String>> hashMaps = new ArrayList<>();
        HashMap<String,String>   stringStringHashMap = new HashMap<>();
        HashMap<String, String> stringStringHashMap1=new HashMap<>();
        String set="install";

        //AI
        DevDictionaries devDictionariesAI = new DevDictionaries();
        devDictionariesAI.setName("AI Mode");
        devDictionariesAI.setCode("AI");
        devDictionariesAI.setDescription("available starting Jan 2025");
        devDictionariesAI.setDataType(0);
        devDictionariesAI.setRelevanceTable("dev_info_msg1");
        devDictionariesAI.setClassify(0 + "");
        devDictionariesAI.setOpe(false);
        devDictionaries.add(devDictionariesAI);


        //静音开关
        DevDictionaries devDictionaries3 = new DevDictionaries();
        devDictionaries3.setName("Mute Beep");
        devDictionaries3.setCode("BZ");
        devDictionaries3.setRelevanceTable("dev_info_msg1");
        devDictionaries3.setDataType(0);
        devDictionaries3.setClassify(0 + "");
//        devDictionaries3.setDescription(set+"28");
        devDictionaries.add(devDictionaries3);

        //41 快速关断功能设置
        DevDictionaries devDictionaries5 = new DevDictionaries();
        devDictionaries5.setName("Rapid Shutdown Function");
        devDictionaries5.setCode("RAPIDEN");
        devDictionaries5.setRelevanceTable("dev_info_msg1");
        devDictionaries5.setDataType(0);
        devDictionaries5.setClassify(0 + "");
//        devDictionaries5.setDescription(set+"41");
        devDictionaries.add(devDictionaries5);

        //输出电压  01指令
        DevDictionaries devDictionaries10 = new DevDictionaries();
        devDictionaries10.setName("01 Output voltage");
        devDictionaries10.setCode("VO");
        devDictionaries10.setDataType(1);
        devDictionaries10.setRelevanceTable("dev_info_msg1");
        devDictionaries10.setClassify(2 + "");
        devDictionaries10.setState("1");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110V", "1100");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120V", "1200");
        hashMaps.add(stringStringHashMap);
        devDictionaries10.setOptions(hashMaps);
        devDictionaries.add(devDictionaries10);


        //输出频率 02指令
        DevDictionaries devDictionaries11 = new DevDictionaries();
        devDictionaries11.setName("02 Output Frenquency");
        devDictionaries11.setCode("FO");
        devDictionaries11.setDataType(1);
        devDictionaries11.setRelevanceTable("dev_info_msg1");
        devDictionaries11.setClassify(2 + "");
        devDictionaries11.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50HZ", "50");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60HZ", "60");
        hashMaps.add(stringStringHashMap);
        devDictionaries11.setOptions(hashMaps);
        devDictionaries.add(devDictionaries11);



        DevDictionaries devDictionariesBT = new DevDictionaries();
        devDictionariesBT.setName("03 Battery Type");
        devDictionariesBT.setCode("BT");
        devDictionariesBT.setDataType(1);
        devDictionariesBT.setRelevanceTable("dev_info_msg1");
        devDictionariesBT.setClassify(2 + "");
        devDictionariesBT.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("User-Defined(default)(USE)", "0");
        stringStringHashMap.put("desc","If “User Defined” is selected, battery charge voltage and low DC cut off voltage can be set up in program 4, 7, 8and 9.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Pylontech battery(PYL)", "1");
        stringStringHashMap.put("desc","If “If selected, programs of 4, 7, 8 and 9 will be automatically set up. No need for further setting.");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("WECO battery(WEC)", "3");
        stringStringHashMap.put("desc","If selected, programs of 4, 7, 8 and9 will be auto configured per battery supplier recommended. No need for further adjustment.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Soltaro batter(SQL)", "4");
        stringStringHashMap.put("desc","If selected, programs of 4, 7, 8 and9 will be auto configured per battery supplier recommended. No need for further adjustment.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("LIb-protocol compatible battery(LIB)", "6");
        stringStringHashMap.put("desc","Select “LIb” if using Lithium battery compatible to Lib protocol. If selected, programs of4, 7, 8and 9 will be automatically set up. No need for further setting.");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Party Lithium battery(LIC)", "7");
        stringStringHashMap.put("desc","If selected, programs of 4, 7, 8 and 9 will be automatically set up. No need for further setting. Please contact the battery supplier for installation procedure.");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("VSC(VSC)", "8");
        stringStringHashMap.put("desc","If selected, standard CAN protocol will be supported.");
        hashMaps.add(stringStringHashMap);
        devDictionariesBT.setOptions(hashMaps);


        devDictionaries.add(devDictionariesBT);


        //最大AC充电电流
        DevDictionaries devDictionariesMCC = new DevDictionaries();
        devDictionariesMCC.setName("04 Max Charging Current  (PV + Grid)");
        devDictionariesMCC.setCode("MCC");
        devDictionariesMCC.setDataType(6);
        devDictionariesMCC.setRelevanceTable("dev_info_msg1");
        devDictionariesMCC.setDescription("pv+Grid");
        devDictionariesMCC.setDesc("Setting range is 1A, then from 10A to 120A.Increment of each click is 10A.");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("10A", "0100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("20A", "0200");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("30A", "0300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("40A", "0400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A", "0500");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("70A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("80A", "0800");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("90A", "0900");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("100A", "1000");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110A", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120A", "1200");
        hashMaps.add(stringStringHashMap);


        devDictionariesMCC.setOptions(hashMaps);
        devDictionariesMCC.setClassify(2 + "");


        devDictionaries.add(devDictionariesMCC);

        //最大AC充电电流
        DevDictionaries devDictionaries21 = new DevDictionaries();
        devDictionaries21.setName("05 Max Utility Charging Current（UTI）");
        devDictionaries21.setCode("MCG");
        devDictionaries21.setDataType(6);
        devDictionaries21.setRelevanceTable("dev_info_msg1");
        devDictionaries21.setDesc("Setting range is from 10A to 120A. Increment of each click is 10A.");
//        devDictionariesMCC.setDescription("pv+Grid");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("10A", "0100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("20A", "0200");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("30A", "0300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("40A", "0400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A", "0500");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("70A", "0700");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("80A", "0800");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("90A", "0900");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("100A", "1000");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110A", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120A", "1200");
        hashMaps.add(stringStringHashMap);


        devDictionaries21.setOptions(hashMaps);
        devDictionaries21.setClassify(2 + "");

        devDictionaries.add(devDictionaries21);


        //        hybrid模式下电池最大放电电流
        DevDictionaries devDictionariesMDH = new DevDictionaries();
        devDictionariesMDH.setName("06 Max Discharging Current When Grid is Available");
        devDictionariesMDH.setCode("MDH");
        devDictionariesMDH.setDataType(6);
        devDictionariesMDH.setDesc("Setting range is from 10A to 120A. Increment of each click is 10A.");
        devDictionariesMDH.setRelevanceTable("dev_info_msg1");

        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("10A", "0100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("20A", "0200");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("30A", "0300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("40A", "0400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A", "0500");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("70A", "0700");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("80A", "0800");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("90A", "0900");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("100A", "1000");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110A", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120A", "1200");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("130A", "1300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("140A", "1400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("150A", "1500");
        hashMaps.add(stringStringHashMap);

        devDictionariesMDH.setOptions(hashMaps);
        devDictionariesMDH.setClassify(2 + "");

        devDictionaries.add(devDictionariesMDH);


        //电池C.V电压07
        DevDictionaries devDictionariesBVM = new DevDictionaries();
        devDictionariesBVM.setName("07 Bulk charging voltage （C.V）");
        devDictionariesBVM.setCode("BVM");
        devDictionariesBVM.setDataType(7);
        devDictionariesBVM.setRelevanceTable("dev_info_msg1");
        devDictionariesBVM.setClassify(2 + "");
        devDictionariesBVM.setDescription(set+"07");
        devDictionariesBVM.setDesc("Setting range is from 48.0V to 62.0V. Increment of each click is 0.1V.");
        devDictionariesBVM.setDescription("C.V voltage");
        devDictionaries.add(devDictionariesBVM);


        //电池浮充电压08
        DevDictionaries devDictionariesBVF = new DevDictionaries();
        devDictionariesBVF.setName("08 Floating charging voltage（FLV）");
        devDictionariesBVF.setCode("BVF");
        devDictionariesBVF.setDataType(7);
        devDictionariesBVF.setRelevanceTable("dev_info_msg1");
        devDictionariesBVF.setClassify(2 + "");
        devDictionariesBVF.setDesc("Setting range is from 48.0V to 62.0V. Increment of each click is 0.1V.");

        devDictionaries.add(devDictionariesBVF);


        //无市电时电池放电截止SOC(有BMS时)09
        DevDictionaries devDictionariesBSOC1 = new DevDictionaries();
        devDictionariesBSOC1.setName("09 Low DC cut off " +
                "battery voltage " +
                "setting or " +
                "battery SOC " +
                "when grid is " +
                "unavailable");
        devDictionariesBSOC1.setCode("BSOC1");
        devDictionariesBSOC1.setDataType(6);
        devDictionariesBSOC1.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOC1.setClassify(2 + "");
        devDictionariesBSOC1.setDesc("Setting range is from 0% to 80%. Increment of each click is 5%.");

        hashMaps = new ArrayList<>();
        for (int i = 0; i < 17; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put(((i)*5)+"%", "0"+((i)*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOC1.setOptions(hashMaps);
        devDictionaries.add(devDictionariesBSOC1);



        //无市电时电池恢复放电SOC(有BMS时)10
        DevDictionaries devDictionariesBSOC2 = new DevDictionaries();
        devDictionariesBSOC2.setName("10 Battery re-discharging " +
                "voltage or " +
                "battery SOC " +
                "when grid is " +
                "unavailable");
        devDictionariesBSOC2.setCode("BSOC2");
        devDictionariesBSOC2.setDataType(6);
        devDictionariesBSOC2.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOC2.setClassify(2 + "");

        devDictionariesBSOC2.setDesc("Setting range is from 0% to 80%. Increment of each click is 5%.");
        hashMaps = new ArrayList<>();
        for (int i = 0; i < 17; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put(((i)*5)+"%", "0"+((i)*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOC2.setOptions(hashMaps);
        devDictionaries.add(devDictionariesBSOC2);


        //无市电时电池放电截止SOC(有BMS时)11
        DevDictionaries devDictionariesBSOCG1 = new DevDictionaries();
        devDictionariesBSOCG1.setName("11 Low DC cut off " +
                "battery voltage " +
                "or battery SOC " +
                "when grid is " +
                "available");
        devDictionariesBSOCG1.setCode("BSOCG1");
        devDictionariesBSOCG1.setDataType(6);
        devDictionariesBSOCG1.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOCG1.setDesc("Setting range is from 5% to 95%. Increment of each click is 5%.");
        devDictionariesBSOCG1.setClassify(2 + "");

        hashMaps = new ArrayList<>();
        for (int i = 1; i < 20; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put((i*5)+"%","0"+(i*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOCG1.setOptions(hashMaps);
        devDictionaries.add(devDictionariesBSOCG1);


        //无市电时电池恢复放电SOC(有BMS时)12
        DevDictionaries devDictionariesBSOCG2 = new DevDictionaries();
        devDictionariesBSOCG2.setName("12 Battery re-discharging " +
                "voltage or " +
                "battery SOC " +
                "when grid is " +
                "available");
        devDictionariesBSOCG2.setCode("BSOCG2");
        devDictionariesBSOCG2.setDataType(6);
        devDictionariesBSOCG2.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOCG2.setClassify(2 + "");
        devDictionariesBSOCG1.setDesc("Setting range is from 5% to 95%. Increment of each click is 5%.");
        hashMaps = new ArrayList<>();
        for (int i = 1; i < 20; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put((i*5)+"%", "0"+(i*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOCG2.setOptions(hashMaps);
        devDictionaries.add(devDictionariesBSOCG2);

        //工作模式设置13
        DevDictionaries devDictionaries1 = new DevDictionaries();
        devDictionaries1.setName("13 Operation Mode");
        devDictionaries1.setCode("RL");
        devDictionaries1.setRelevanceTable("dev_info_msg1");
        devDictionaries1.setDataType(1);
        devDictionaries1.setDescription("Refer to Section 12 for the detailed operation");
        devDictionaries1.setClassify(2 + "");
        devDictionaries1.setState(1 + "");

        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Grid-tie with backup(HBD)", "077");
        stringStringHashMap.put("desc","PV power can feed-in back to grid, provide power to the load and charge battery.");
        hashMaps.add(stringStringHashMap);

//        stringStringHashMap = new HashMap<>();
//        stringStringHashMap.put("Grid-Tie(GTI)", "127");
//        stringStringHashMap.put("desc","PV power only provides power to the load and charge battery. No feed-in back to grid is allowed.");
//        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Off-Grid(OFG)", "150");
        stringStringHashMap.put("desc","PV power only can feed-in back to grid.");
        hashMaps.add(stringStringHashMap);
        devDictionaries1.setOptions(hashMaps);
        devDictionaries.add(devDictionaries1);


        //solar能量分配优先级
        DevDictionaries devDictionaries18 = new DevDictionaries();
        devDictionaries18.setName("14 PV energy supply priority setting");
        devDictionaries18.setCode("SP");
        devDictionaries18.setDataType(1);
        devDictionaries18.setRelevanceTable("dev_info_msg1");
        devDictionaries18.setClassify(2 + "");
        hashMaps = new ArrayList<>();

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Grid-tie with backup Mode(HBD)", "03");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap.put("desc","If selected, it is only allowed to set up peak time and off peak for electricity demand. Programs of 15, 17, 18, 19 and 20 can’t be set and only programs of 21, 22, 23 and 24 can be set.");

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Battery-Load-Grid(HBD1)", "00");
        stringStringHashMap.put("desc","PV power will charge battery first, then provide power to the load. If there is any remaining power left, it will feed-in to the grid");
        hashMaps.add(stringStringHashMap);


        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Load-Battery-Grid(HBD2)", "01");
        stringStringHashMap.put("desc","PV power will charge battery first, then provide power to the load. If there is any remaining power left, it will feed-in to the grid");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Load-Grid-Battery(HBD3)", "02");
        stringStringHashMap.put("desc","PV power will provide power to the load first. If there is more PV power available, it will feed-in to the grid. If feed-in power reaches max. feed-in power setting, the remaining power will charge battery");
        hashMaps.add(stringStringHashMap);


        devDictionaries18.setOptions(hashMaps);

//        devDictionaries18.setDescription(set+"14");
        devDictionaries.add(devDictionaries18);


        //充电源
        DevDictionaries devDictionaries20 = new DevDictionaries();
        devDictionaries20.setName("15 Charger source priority");
        devDictionaries20.setCode("PCE");
        devDictionaries20.setDataType(1);
        devDictionaries20.setRelevanceTable("dev_info_msg1");
        devDictionaries20.setClassify(2 + "");
        devDictionaries20.setState("1");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Solar and Utility(SNU)", "0");
        stringStringHashMap.put("desc","If there is remaining PV power after supporting the loads, it will charge battery first. Only until PV power is not available, grid will charge battery.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Only Solar(OSO)", "1");
        stringStringHashMap.put("desc","It is only allow PV power to charge battery.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("None(NONE)", "2");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap.put("desc","It is not allowed to charge battery no matter it’s PV power or grid.");
        devDictionaries20.setOptions(hashMaps);
//        devDictionaries20.setDescription(set+"15");
        devDictionaries.add(devDictionaries20);


        //并网控制
        DevDictionaries devDictionaries7 = new DevDictionaries();
        devDictionaries7.setName("16 Feed to Grid (PV)");
        devDictionaries7.setCode("FE");
        devDictionaries7.setRelevanceTable("dev_info_msg1");
        devDictionaries7.setDataType(0);
        devDictionaries7.setClassify(2 + "");
        devDictionaries7.setState(1 + "");
//        devDictionaries7.setDescription(set+ "16");
        devDictionaries.add(devDictionaries7);

        //电池并网控制（太阳能接入）
        DevDictionaries devDictionaries8 = new DevDictionaries();
        devDictionaries8.setName("17 Battery Feed to Grid (PV Available)");
        devDictionaries8.setCode("BFE1");
        devDictionaries8.setRelevanceTable("dev_info_msg1");
        devDictionaries8.setDataType(0);
        devDictionaries8.setClassify(2 + "");
        devDictionaries8.setState(1 + "");
//        devDictionaries8.setDescription(set+"17");
        devDictionaries.add(devDictionaries8);

        //电池并网控制（太阳能未接）
        DevDictionaries devDictionaries9 = new DevDictionaries();
        devDictionaries9.setName("18 Battery Feed to Grid (PV Unavailable)");
        devDictionaries9.setCode("BFE2");
        devDictionaries9.setRelevanceTable("dev_info_msg1");
        devDictionaries9.setDataType(0);
        devDictionaries9.setClassify(2 + "");
        devDictionaries9.setState(1 + "");
//        devDictionaries9.setDescription(set+"18");
        devDictionaries.add(devDictionaries9);

        //PV正常时输出优先级
        DevDictionaries devDictionaries14 = new DevDictionaries();
        devDictionaries14.setName("19 Load supply source ");
        devDictionaries14.setCode("PDE1");
        devDictionaries14.setDescription("PV is available");
        devDictionaries14.setDataType(1);
        devDictionaries14.setRelevanceTable("dev_info_msg1");
        devDictionaries14.setClassify(2+"");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("SUB", "0");
        stringStringHashMap.put("desc","PV power will provide power to the load first. If it’s not sufficient, grid will provide power to the load. If grid is not available at the same time, battery power will back up.");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("SBU", "1");
        stringStringHashMap.put("desc","PV power will provide power to the load first. If it’s not sufficient, battery power will provide power to the load");
        hashMaps.add(stringStringHashMap);
        devDictionaries14.setOptions(hashMaps);
//        devDictionaries14.setDescription(set+"19");
        devDictionaries.add(devDictionaries14);


        //PV异常时输出优先级
        DevDictionaries devDictionaries15 = new DevDictionaries();
        devDictionaries15.setName("20 Load supply source");
        devDictionaries15.setCode("PDE2");
        devDictionaries15.setDataType(1);
        devDictionaries15.setRelevanceTable("dev_info_msg1");
        devDictionaries15.setDescription("PV is unavailable");
        devDictionaries15.setClassify(2 + "");
        devDictionaries15.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("UB", "0");

        stringStringHashMap.put("desc","Grid will provide power to the load at first. If grid is not available, battery power will provide power backup.");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("desc","Battery power will provide power to the load at first. If battery power is running out, grid will back up the load. This setting is ineffective during of AC charging.");
        stringStringHashMap.put("BU", "1");
        hashMaps.add(stringStringHashMap);
        devDictionaries15.setOptions(hashMaps);
//        devDictionaries15.setDescription(set+"20");
        devDictionaries.add(devDictionaries15);


        //21 AC开始充电时间1
        DevDictionaries devDictionaries22 = new DevDictionaries();
        devDictionaries22.setName("Start time AC Charging 1");
        devDictionaries22.setCode("TS1");
        devDictionaries22.setDataType(3);
        devDictionaries22.setRelevanceTable("dev_info_msg1");
        devDictionaries22.setClassify(0 + "");
        devDictionaries22.setOperation("x/100");
//        devDictionaries22.setDescription(set+"21");
        devDictionaries.add(devDictionaries22);

        //22 AC结束充电时间1
        DevDictionaries devDictionaries23 = new DevDictionaries();
        devDictionaries23.setName("End time AC Charging 1");
        devDictionaries23.setCode("TE1");
        devDictionaries23.setDataType(3);
        devDictionaries23.setRelevanceTable("dev_info_msg1");
        devDictionaries23.setClassify(0 + "");
        devDictionaries23.setOperation("x/100");
//        devDictionaries23.setDescription(set+"22");
        devDictionaries.add(devDictionaries23);

        //23 AC开始充电时间2
        DevDictionaries devDictionaries24 = new DevDictionaries();
        devDictionaries24.setName("Start time AC Charging 2");
        devDictionaries24.setCode("TS2");
        devDictionaries24.setDataType(3);
        devDictionaries24.setRelevanceTable("dev_info_msg1");
        devDictionaries24.setClassify(0 + "");
        devDictionaries24.setOperation("x/100");
//        devDictionaries24.setDescription(set+"23");
        devDictionaries.add(devDictionaries24);

        //24 AC结束充电时间2
        DevDictionaries devDictionaries25 = new DevDictionaries();
        devDictionaries25.setName("End time AC Charging 2");
        devDictionaries25.setCode("TE2");
        devDictionaries25.setDataType(3);
        devDictionaries25.setRelevanceTable("dev_info_msg1");
        devDictionaries25.setClassify(0 + "");
        devDictionaries25.setOperation("x/100");
//        devDictionaries25.setDescription(set+"24");
        devDictionaries.add(devDictionaries25);



        //21 AC开始充电时间1
        DevDictionaries devDictionaries22L = new DevDictionaries();
        devDictionaries22L.setName("21 Start time AC Charging 1");
        devDictionaries22L.setCode("TS1");
        devDictionaries22L.setDataType(3);
        devDictionaries22L.setRelevanceTable("dev_info_msg1");
        devDictionaries22L.setClassify(2 + "");
        devDictionaries22L.setOperation("x/100");
//        devDictionaries22.setDescription(set+"21");
        devDictionaries.add(devDictionaries22L);

        //22 AC结束充电时间1
        DevDictionaries devDictionaries23L = new DevDictionaries();
        devDictionaries23L.setName("22 End time AC Charging 1");
        devDictionaries23L.setCode("TE1");
        devDictionaries23L.setDataType(3);
        devDictionaries23L.setRelevanceTable("dev_info_msg1");
        devDictionaries23L.setClassify(2 + "");
        devDictionaries23L.setOperation("x/100");
//        devDictionaries23.setDescription(set+"22");
        devDictionaries.add(devDictionaries23L);

        //23 AC开始充电时间2
        DevDictionaries devDictionaries24L = new DevDictionaries();
        devDictionaries24L.setName("23 Start time AC Charging 2");
        devDictionaries24L.setCode("TS2");
        devDictionaries24L.setDataType(3);
        devDictionaries24L.setRelevanceTable("dev_info_msg1");
        devDictionaries24L.setClassify(2 + "");
        devDictionaries24L.setOperation("x/100");
//        devDictionaries24.setDescription(set+"23");
        devDictionaries.add(devDictionaries24L);

        //24 AC结束充电时间2
        DevDictionaries devDictionaries25L = new DevDictionaries();
        devDictionaries25L.setName("24 End time AC Charging 2");
        devDictionaries25L.setCode("TE2");
        devDictionaries25L.setDataType(3);
        devDictionaries25L.setRelevanceTable("dev_info_msg1");
        devDictionaries25L.setClassify(2 + "");
        devDictionaries25L.setOperation("x/100");
//        devDictionaries25.setDescription(set+"24");
        devDictionaries.add(devDictionaries25L);


        //AC带载开启时间
        DevDictionaries devDictionaries16 = new DevDictionaries();
        devDictionaries16.setName("25 Start time Enable AC supply load");
        devDictionaries16.setCode("TSL");
        devDictionaries16.setDataType(3);
        devDictionaries16.setRelevanceTable("dev_info_msg1");
        devDictionaries16.setClassify(2 + "");
        devDictionaries16.setState("0");
        devDictionaries16.setOperation("x/100");
//        devDictionaries16.setDescription(set+"25");
        devDictionaries.add(devDictionaries16);


        //AC带载开启时间
        DevDictionaries devDictionaries17 = new DevDictionaries();
        devDictionaries17.setName("26 End time Enable AC supply load");
        devDictionaries17.setCode("TEL");
        devDictionaries17.setDataType(3);
        devDictionaries17.setRelevanceTable("dev_info_msg1");
        devDictionaries17.setClassify(2 + "");
        devDictionaries17.setState("0");
        devDictionaries17.setOperation("x/100");
//        devDictionaries17.setDescription(set+"26");
        devDictionaries.add(devDictionaries17);


        // 27 LCD休眠等待时间
        DevDictionaries devDictionaries2L = new DevDictionaries();
        devDictionaries2L.setName("27 LCD Off Waiting Time");
        devDictionaries2L.setCode("LST");
        devDictionaries2L.setRelevanceTable("dev_info_msg1");
        devDictionaries2L.setDataType(1);
        devDictionaries2L.setClassify(2 + "");
        devDictionaries2L.setUnit("s");
        hashMaps = new ArrayList<>();
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("30s", "01");
        hashMaps.add(stringStringHashMap1);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("60s", "02");
        hashMaps.add(stringStringHashMap1);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("300s", "10");
        hashMaps.add(stringStringHashMap1);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("600s", "20");
        hashMaps.add(stringStringHashMap1);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("never", "00");
        hashMaps.add(stringStringHashMap);
        devDictionaries2L.setOptions(hashMaps);
//        devDictionaries2.setDescription(set+"27");
        devDictionariesOld.add(devDictionaries2L);


        //28静音开关
        DevDictionaries devDictionaries3L = new DevDictionaries();
        devDictionaries3L.setName("28 Alarm Contro");
        devDictionaries3L.setCode("BZ");
        devDictionaries3L.setRelevanceTable("dev_info_msg1");
        devDictionaries3L.setDataType(2);
        devDictionaries3L.setClassify(0 + "");
//        devDictionaries3.setDescription(set+"28");
        devDictionariesOld.add(devDictionaries3L);









        //锂电池
        DevDictionaries devDictionariesBBA = new DevDictionaries();
        devDictionariesBBA.setName("31 Li_Bat Active Function");
        devDictionariesBBA.setCode("BBA");
        devDictionariesBBA.setRelevanceTable("dev_info_msg1");
        devDictionariesBBA.setDataType(0);
        devDictionariesBBA.setClassify(2 + "");
//        devDictionariesBBA.setDescription(set+"31");
        devDictionaries.add(devDictionariesBBA);


        DevDictionaries devDictionaries13 = new DevDictionaries();
        devDictionaries13.setName("32 Output Mode");
        devDictionaries13.setCode("OM");
        devDictionaries13.setDataType(1);
        devDictionaries13.setRelevanceTable("dev_info_msg1");
        devDictionaries13.setClassify(2 + "");
        devDictionaries13.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Single", "0");
        stringStringHashMap.put("desc","Single: This inverter is used in single phase application (default)");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("Parallel", "1");
        stringStringHashMap1.put("desc","Parallel: This inverter is operated in parallel system");
        hashMaps.add(stringStringHashMap1);
        devDictionaries13.setOptions(hashMaps);
//        devDictionaries13.setDescription(set+"32");
        devDictionaries.add(devDictionaries13);


        //发电机使能 33
        DevDictionaries devDictionariesGGI = new DevDictionaries();
        devDictionariesGGI.setName("33 Generator as AC source");
        devDictionariesGGI.setCode("GGI");
        devDictionariesGGI.setDataType(0);
        devDictionariesGGI.setRelevanceTable("dev_info_msg1");
        devDictionariesGGI.setClassify(2 + "");
//        devDictionariesGGI.setDescription(set+"33");
        devDictionaries.add(devDictionariesGGI);

        //宽的AC输入 34
        DevDictionaries devDictionariesWGI = new DevDictionaries();
        devDictionariesWGI.setName("34 Wide AC input range");
        devDictionariesWGI.setCode("WGI");
        devDictionariesWGI.setDataType(0);
        devDictionariesWGI.setRelevanceTable("dev_info_msg1");
        devDictionariesWGI.setClassify(2 + "");
//        devDictionariesWGI.setDescription(set+"34");
        devDictionaries.add(devDictionariesWGI);


        DevDictionaries devDictionaries4L = new DevDictionaries();
        devDictionaries4L.setCode("ECTS");
        devDictionaries4L.setName("36 External CT function");
        devDictionaries4L.setRelevanceTable("dev_info_msg1");
        devDictionaries4L.setDataType(1);
        devDictionaries4L.setDescription("Refer to Appendix III for the details");
        devDictionaries4L.setClassify(2 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Disable", "00");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A-single", "01");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A-parallel", "02");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("200A-single", "03");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("200A-parallel", "04");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        devDictionaries4L.setOptions(hashMaps);
//        devDictionaries4.setDescription(set+"36");
        devDictionaries.add(devDictionaries4L);

        //设置时间
        DevDictionaries devDictionaries26 = new DevDictionaries();
        devDictionaries26.setName("Date Setting");
        devDictionaries26.setCode("T");
        devDictionaries26.setDataType(4);
        devDictionaries26.setRelevanceTable("dev_info_msg0");
        devDictionaries26.setClassify(0 + "");
        devDictionaries.add(devDictionaries26);


        //设置时区
        DevDictionaries devDictionaries27 = new DevDictionaries();
        devDictionaries27.setName("Time Setting");
        devDictionaries27.setCode("T");
        devDictionaries27.setDataType(4);
        devDictionaries27.setRelevanceTable("dev_info_msg0");
        devDictionaries27.setClassify(0 + "");
        devDictionaries27.setState("1");
        devDictionaries.add(devDictionaries27);

        //工作模式设置13




        //36 外部CT功能
        DevDictionaries devDictionaries4 = new DevDictionaries();
        devDictionaries4.setCode("ECTS");
        devDictionaries4.setName("External CT function");
        devDictionaries4.setRelevanceTable("dev_info_msg1");
        devDictionaries4.setDataType(1);
        devDictionaries4.setDescription("Refer to Appendix III for the details");
        devDictionaries4.setClassify(0 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Disable", "00");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A-single", "01");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A-parallel", "02");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("200A-single", "03");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("200A-parallel", "04");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        devDictionaries4.setOptions(hashMaps);
//        devDictionaries4.setDescription(set+"36");
        devDictionaries.add(devDictionaries4);



        // 27 LCD休眠等待时间
        DevDictionaries devDictionaries2 = new DevDictionaries();
        devDictionaries2.setName("Screen time out");
        devDictionaries2.setCode("LST");
        devDictionaries2.setRelevanceTable("dev_info_msg1");
        devDictionaries2.setDataType(1);
        devDictionaries2.setClassify(0 + "");
        devDictionaries2.setUnit("s");
        hashMaps = new ArrayList<>();
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("30s", "01");
        hashMaps.add(stringStringHashMap1);
        HashMap<String, String> stringStringHashMap2 = new HashMap<>();
        stringStringHashMap2.put("60s", "02");
        hashMaps.add(stringStringHashMap2);
        HashMap<String, String> stringStringHashMap3 = new HashMap<>();
        stringStringHashMap3.put("300s", "10");
        hashMaps.add(stringStringHashMap3);
        HashMap<String, String> stringStringHashMap4 = new HashMap<>();
        stringStringHashMap4.put("600s", "20");
        hashMaps.add(stringStringHashMap4);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("never", "00");
        hashMaps.add(stringStringHashMap);
        devDictionaries2.setOptions(hashMaps);
//        devDictionaries2.setDescription(set+"27");
        devDictionaries.add(devDictionaries2);

        //PV并联
        DevDictionaries devDictionaries19 = new DevDictionaries();
        devDictionaries19.setName("37 PV1/PV2 Paralle");
        devDictionaries19.setCode("PVP");
        devDictionaries19.setDataType(0);
        devDictionaries19.setRelevanceTable("dev_info_msg1");
        devDictionaries19.setClassify(2 + "");
//        devDictionaries19.setDescription(set+"37");
        devDictionaries.add(devDictionaries19);




        //发动机
        DevDictionaries devDictionariesGENP = new DevDictionaries();
        devDictionariesGENP.setName("38-39 Generator Port Function");
        devDictionariesGENP.setCode("GENP");
        devDictionariesGENP.setRelevanceTable("dev_info_msg2");
        devDictionariesGENP.setDataType(1);
        devDictionariesGENP.setClassify(2 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Disable", "0");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Generator", "2");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("AC Coupling", "3");
        hashMaps.add(stringStringHashMap);
        devDictionariesGENP.setOptions(hashMaps);
//        devDictionariesGENP.setDescription(set+"38-39");
        devDictionaries.add(devDictionariesGENP);





//        hashMaps = new ArrayList<>();





        //输出相角
        DevDictionaries devDictionaries12 = new DevDictionaries();
        devDictionaries12.setName("40 Output Phase Angle");
        devDictionaries12.setCode("OPANG");
        devDictionaries12.setDataType(1);
        devDictionaries12.setRelevanceTable("dev_info_msg1");
        devDictionaries12.setClassify(2 + "");
        devDictionaries12.setState("1");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120°", "1");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("180°", "2");
        hashMaps.add(stringStringHashMap1);
        devDictionaries12.setOptions(hashMaps);
//        devDictionaries12.setDescription(set+"40");
        devDictionaries.add(devDictionaries12);

        DevDictionaries devDictionaries5L = new DevDictionaries();
        devDictionaries5L.setName("41 Rapid Shutdown Function");
        devDictionaries5L.setCode("RAPIDEN");
        devDictionaries5L.setRelevanceTable("dev_info_msg1");
        devDictionaries5L.setDataType(0);
        devDictionaries5L.setClassify(2 + "");
//        devDictionaries5.setDescription(set+"41");
        devDictionaries.add(devDictionaries5L);





        //电网法规
        DevDictionaries devDictionaries6 = new DevDictionaries();
        devDictionaries6.setName("Grid Standard");
        devDictionaries6.setCode("RL");
        devDictionaries6.setRelevanceTable("dev_info_msg1");
        devDictionaries6.setDataType(1);
        hashMaps = new ArrayList<>();
        devDictionaries6.setState(0 + "");
        devDictionaries.add(devDictionaries6);

        //LOG交流输出控制
        DevDictionaries devDictionariesLOG = new DevDictionaries();
        devDictionariesLOG.setName("Ac output control");
        devDictionariesLOG.setCode("LOG");
        devDictionariesLOG.setDataType(0);
        devDictionariesLOG.setRelevanceTable("dev_info_msg1");
        devDictionariesLOG.setClassify(2 + "");
        devDictionariesLOG.setState("0");
        devDictionariesLOG.setDescription("Ac output control");
        devDictionaries.add(devDictionariesLOG);



//        devDictionaries27.setOpe(false);


        //恢复出厂设置
        DevDictionaries devDictionaries30 = new DevDictionaries();
        devDictionaries30.setName("Factory data reset");
        devDictionaries30.setCode("FR");
        devDictionaries30.setDataType(2);
        devDictionaries30.setRelevanceTable("dev_info_msg0");
        devDictionaries30.setClassify(6 + "");
        devDictionaries30.setState("1");

        //固件升级
        DevDictionaries devDictionaries29 = new DevDictionaries();
        devDictionaries29.setName("DSP Firmware Version");
        devDictionaries29.setCode("OTA");
        devDictionaries29.setDataType(5);
        devDictionaries29.setRelevanceTable("dev_info_msg3");
        devDictionaries29.setClassify(1 + "");
        devDictionaries29.setState("1");
        devDictionaries.add(devDictionaries29);

        DevDictionaries devDictionaries32 = new DevDictionaries();
        devDictionaries32.setName("dsp update firmware");
        devDictionaries32.setCode("FWV1");
        devDictionaries32.setDataType(5);
        devDictionaries32.setRelevanceTable("dev_info_msg3");
        devDictionaries32.setClassify(1 + "");
        devDictionaries32.setState("0");
        devDictionaries.add(devDictionaries32);

        DevDictionaries devDictionaries33 = new DevDictionaries();
        devDictionaries33.setName("dsp update firmware");
        devDictionaries33.setCode("FWV3");
        devDictionaries33.setDataType(5);
        devDictionaries33.setRelevanceTable("dev_info_msg3");
        devDictionaries33.setClassify(1 + "");
        devDictionaries33.setState("0");
        devDictionaries.add(devDictionaries33);
//        devDictionaries29.setOpe(false);

        DevDictionaries devDictionaries31 = new DevDictionaries();
        devDictionaries31.setName("Remote Frimware Version");
        devDictionaries31.setCode("OTA9");
        devDictionaries31.setDataType(5);
        devDictionaries31.setRelevanceTable("dev_info_msg3");
        devDictionaries31.setClassify(1 + "");
        devDictionaries31.setState("1");
        devDictionaries31.setOpe(false);
        devDictionaries.add(devDictionaries31);

        //恢复出厂设置
        DevDictionaries devDictionaries28 = new DevDictionaries();
        devDictionaries28.setName("factory data reset");
        devDictionaries28.setCode("T");
        devDictionaries28.setDataType(5);
        devDictionaries28.setRelevanceTable("dev_info_msg0");
        devDictionaries28.setClassify(6 + "");
        devDictionaries28.setState("1");
        devDictionaries.add(devDictionaries28);

        loadDataOld();

    }

    //    @PostConstruct

    public ArrayList<AppDataVo> loadData(String sn, String version) {
        return loadData(sn,version,"");
    }
    public ArrayList<AppDataVo> loadData(String sn,String version,String id) {

        AtomicReference<String> FWV1= new AtomicReference<>("");
        AtomicReference<String> FWV3= new AtomicReference<>("");
        List<DevDictionaries> devDictionariesList= new ArrayList<>();
        if(version.equals("new")){
           devDictionariesList = DevSqlUtil.DevDataSql(devDictionaries, jdbcTemplate, sn);
        }else {
            devDictionariesList = DevSqlUtil.DevDataSql(devDictionariesOld, jdbcTemplate, sn);
        }

        devDictionariesList.stream().forEach(e -> {
            if(e.getCode().equals("FWV1")){
                FWV1.set(e.getValue());
            }
            if(e.getCode().equals("FWV3")){
                FWV3.set(e.getValue());
            }
            if (StringUtils.isEmpty(e.getState())) {
                e.setState("1");
            }
            if (!StringUtils.isEmpty(e.getValue())) {
                e.setValue(e.getValue().split(" ")[0]);
            }

        });

        AppDataVo appDataVo = new AppDataVo();
        appDataVo.setName("User Setting");
        appDataVo.setShow(true);


        AppDataVo appDataV1 = new AppDataVo();
        appDataV1.setName("OTA Update");
        appDataV1.setShow(true);

        AppDataVo appDataV2 = new AppDataVo();
        appDataV2.setName("Installer Setting");
        appDataV2.setShow(true);

        AppDataVo appDataV3 = new AppDataVo();
        appDataV3.setName("PV");
        appDataV3.setShow(false);

        AppDataVo appDataV4 = new AppDataVo();
        appDataV4.setName("battery");
        appDataV4.setShow(false);

        AppDataVo appDataV5 = new AppDataVo();
        appDataV5.setName("control");
        appDataV5.setShow(false);

        AppDataVo appDataV6 = new AppDataVo();
        appDataV6.setName("else");
        appDataV6.setShow(false);

//

        ArrayList<DevSetVo> devSetVos = new ArrayList<>();
        String[] t = {"0"};
        devDictionariesList.stream().filter(devDictionaries11 -> {
            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("0");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {

            if (e.getCode().equals("LST")) {
                e.setValue(Integer.parseInt(e.getValue()) * 30 + "s");
                if (e.getValue().equals("0s")) {
                    e.setValue("never");
                }
            }else if (e.getCode().equals("ECTS")) {
                if (e.getValue().equals("0")) {
                    e.setValue("Disable");
                }
                if (e.getValue().equals("1")) {
                    e.setValue("100A-single");
                }
                if (e.getValue().equals("2")) {
                    e.setValue("100A-parallel");
                }
                if (e.getValue().equals("3")) {
                    e.setValue("200A-single");
                }
                if (e.getValue().equals("4")) {
                    e.setValue("200A-parallel");
                }
            }


            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            if (e.getCode().equals("T")){
                if ( t[0].equals("1")) devSetVo.setCode("F1");
                t[0]="1";

            }




            devSetVo.setValue(e.getValue());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            devSetVo.setOptions(e.getOptions());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));
            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            //kkkc
            devSetVo.setSequence(e.getDescription());
            if(e.getCode().equals("AI")){
                devSetVo.setAvailable(false);
            }

            devSetVos.add(devSetVo);
        });

        appDataVo.setItems(devSetVos);
        ArrayList<DevSetVo> devSetVo1 = new ArrayList<>();

        devDictionariesList.stream().filter(devDictionaries11 -> {

            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("1");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {

            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            devSetVo.setValue(e.getValue());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            if (e.getCode().equals("OTA")){
                devSetVo.setValue(FWV1.get());
            }
            if (e.getCode().equals("OTA9")){
                devSetVo.setValue(FWV3.get());
            }
            devSetVo.setOptions(e.getOptions());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));

            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            devSetVo1.add(devSetVo);
        });
        appDataV1.setItems(devSetVo1);


        ArrayList<DevSetVo> devSetVo2 = new ArrayList<>();
        devDictionariesList.stream().filter(devDictionaries11 -> {
            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("2");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {
            if (e.getCode().equals("LST")) {
                e.setValue(Integer.parseInt(e.getValue()) * 30 + "s");
                if (e.getValue().equals("0s")) {
                    e.setValue("never");
                }
            }else if (e.getCode().equals("ECTS")) {
                if (e.getValue().equals("0")) {
                    e.setValue("Disable");
                }
                if (e.getValue().equals("1")) {
                    e.setValue("100A-single");
                }
                if (e.getValue().equals("2")) {
                    e.setValue("100A-parallel");
                }
                if (e.getValue().equals("3")) {
                    e.setValue("200A-single");
                }
                if (e.getValue().equals("4")) {
                    e.setValue("200A-parallel");
                }
            }else if (e.getCode().equals("OPANG")) {

                if (e.getValue().equals("1")) {
                    e.setValue("120°");
                } else {
                    e.setValue("180°");
                }
            }else  if(e.getCode().equals("RL")){
                if (e.getValue().equals("77")) {
                    e.setValue("Grid-tie with backup(HBD)");
                }else
                if (e.getValue().equals("127")) {
                    e.setValue("Grid-Tie(GTI)");
                }else  {
                    e.setValue("Off-Grid(OFG)");
                }
            }else
            if(e.getCode().equals("MCG")){
                if (e.getValue().equals("100")) {
                    e.setValue("10A");
                }else
                if (e.getValue().equals("200")) {
                    e.setValue("20A");
                }else
                if (e.getValue().equals("300")) {
                    e.setValue("30A");
                }else
                if (e.getValue().equals("400")) {
                    e.setValue("40A");
                }else
                if (e.getValue().equals("500")) {
                    e.setValue("50A");
                }else
                if (e.getValue().equals("600")) {
                    e.setValue("60A");
                }else
                if (e.getValue().equals("700")) {
                    e.setValue("70A");
                }else
                if (e.getValue().equals("800")) {
                    e.setValue("80A");
                }else
                if (e.getValue().equals("900")) {
                    e.setValue("90A");
                }else
                if (e.getValue().equals("1000")) {
                    e.setValue("100A");
                }else
                if (e.getValue().equals("1100")) {
                    e.setValue("110A");
                }else
                if (e.getValue().equals("1200")) {
                    e.setValue("120A");
                }
            }else
            if(e.getCode().equals("MCC")){
                if (e.getValue().equals("100")) {
                    e.setValue("10A");
                }else
                if (e.getValue().equals("200")) {
                    e.setValue("20A");
                }else
                if (e.getValue().equals("300")) {
                    e.setValue("30A");
                }else
                if (e.getValue().equals("400")) {
                    e.setValue("40A");
                }else
                if (e.getValue().equals("500")) {
                    e.setValue("50A");
                }else
                if (e.getValue().equals("600")) {
                    e.setValue("60A");
                }else
                if (e.getValue().equals("700")) {
                    e.setValue("70A");
                }else
                if (e.getValue().equals("800")) {
                    e.setValue("80A");
                }else
                if (e.getValue().equals("900")) {
                    e.setValue("90A");
                }else
                if (e.getValue().equals("1000")) {
                    e.setValue("100A");
                }else
                if (e.getValue().equals("1100")) {
                    e.setValue("110A");
                }else
                if (e.getValue().equals("1200")) {
                    e.setValue("120A");
                }
            }else
            if(e.getCode().equals("MDH")){
                if (e.getValue().equals("10")) {
                    e.setValue("10A");
                }else
                if (e.getValue().equals("20")) {
                    e.setValue("20A");
                }else
                if (e.getValue().equals("30")) {
                    e.setValue("30A");
                }else
                if (e.getValue().equals("40")) {
                    e.setValue("40A");
                }else
                if (e.getValue().equals("50")) {
                    e.setValue("50A");
                }else
                if (e.getValue().equals("60")) {
                    e.setValue("60A");
                }else
                if (e.getValue().equals("70")) {
                    e.setValue("70A");
                }else
                if (e.getValue().equals("80")) {
                    e.setValue("80A");
                }else
                if (e.getValue().equals("90")) {
                    e.setValue("90A");
                }else
                if (e.getValue().equals("100")) {
                    e.setValue("100A");
                }else
                if (e.getValue().equals("110")) {
                    e.setValue("110A");
                }else
                if (e.getValue().equals("120")) {
                    e.setValue("120A");
                }else
                if (e.getValue().equals("130")) {
                    e.setValue("130A");
                }
                else
                if (e.getValue().equals("140")) {
                    e.setValue("140A");
                }
                else
                if (e.getValue().equals("150")) {
                    e.setValue("150A");

                }
            }else
            if (e.getCode().equals("BT")) {
                if (e.getValue().equals("0")) {
                    e.setValue("User-Defined(default)(USE)");
                }else
                if (e.getValue().equals("1")) {
                    e.setValue("Pylontech battery(PYL)");
                }else
                if (e.getValue().equals("3")) {
                    e.setValue("WECO battery(WEC)");
                }else
                if (e.getValue().equals("4")) {
                    e.setValue("Soltaro batter(SQL)");
                }
                else
                if (e.getValue().equals("8")) {
                    e.setValue("VSC(VSC)");
                }
                else
                if (e.getValue().equals("6")) {
                    e.setValue("LIb-protocol compatible battery(LIB)");
                }
                else
                if (e.getValue().equals("7")) {
                    e.setValue("Party Lithium battery(LIC)");
                }
            }else
            if (e.getCode().equals("PCE")) {
                if (e.getValue().equals("11")) {
                    e.setValue("Solar and Utility(SNU)");
                }else
                if (e.getValue().equals("10")) {
                    e.setValue("Only Solar(OSO)");
                }else
                if (e.getValue().equals("00")) {
                    e.setValue("None(NONE)");
                }

            }
            else
            if (e.getCode().equals("SP")) {
                if (e.getValue().equals("0")) {
                    e.setValue("Battery-Load-Grid(HBD1)");
                }
                if (e.getValue().equals("1")) {
                    e.setValue("Load-Battery-Grid(HBD2)");
                }
                if (e.getValue().equals("2")) {
                    e.setValue("Load-Grid-Battery(HBD3)");
                }
                if (e.getValue().equals("3")) {
                    e.setValue("Grid-tie with backup(HBD)");
                }
            }else
            if (e.getCode().equals("GENP")) {
                if (e.getValue().equals("0")) {
                    e.setValue("Disable");
                }else
                if (e.getValue().equals("2")) {
                    e.setValue("Generator");
                }else
                if (e.getValue().equals("3")) {
                    e.setValue("AC Coupling");
                }

            }
            else if(e.getCode().equals("FO")){
                if (e.getValue().equals("50")) {
                    e.setValue("50HZ");
                }else
                if (e.getValue().equals("60")) {
                    e.setValue("60HZ");
                }
            }else if (e.getCode().equals("VO")) {
                if (e.getValue().equals("120")) {
                    e.setValue("120V");
                }else if (e.getValue().equals("110")) {
                    e.setValue("110V");
                }
            }else if (e.getCode().equals("OM")) {
                if (e.getValue().equals("0")) {
                    e.setValue("Single");
                }else if (e.getValue().equals("1")) {
                    e.setValue("Parallel");
                }
            }else if (e.getCode().equals("PDE2")) {
                if (e.getValue().equals("0")) {
                    e.setValue("UB");
                }else if (e.getValue().equals("1")) {
                    e.setValue("BU");
                }
            }else if (e.getCode().equals("PDE1")) {
                if (e.getValue().equals("0")) {
                    e.setValue("SUB");
                }else if (e.getValue().equals("1")) {
                    e.setValue("SBU");
                }
            }else if (e.getCode().equals("BSOC1")) {
                e.setValue( e.getValue()+"%");
            }else if (e.getCode().equals("BSOC2")) {
                e.setValue( e.getValue()+"%");
            }else if (e.getCode().equals("BSOCG1")) {
                e.setValue( e.getValue()+"%");
            }else if (e.getCode().equals("BSOCG2")) {
                e.setValue( e.getValue()+"%");
            }
            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            devSetVo.setValue(e.getValue());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            devSetVo.setOptions(e.getOptions());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));
            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            devSetVo2.add(devSetVo);
        });
        appDataV2.setItems(devSetVo2);

        ArrayList<DevSetVo> devSetVo3 = new ArrayList<>();
        devDictionariesList.stream().filter(devDictionaries11 -> {
            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("3");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {


            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            devSetVo.setValue(e.getValue());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            devSetVo.setOptions(e.getOptions());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));
            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            devSetVo3.add(devSetVo);
        });

        appDataV3.setItems(devSetVo3);


        ArrayList<DevSetVo> devSetVo4 = new ArrayList<>();
        devDictionariesList.stream().filter(devDictionaries11 -> {
            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("4");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {
            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            devSetVo.setValue(e.getValue());
            devSetVo.setOptions(e.getOptions());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));
            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            devSetVo4.add(devSetVo);
        });
        appDataV4.setItems(devSetVo4);


        ArrayList<DevSetVo> devSetVo5 = new ArrayList<>();
        devDictionariesList.stream().filter(devDictionaries11 -> {
            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("5");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {
            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            devSetVo.setValue(e.getValue());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setOptions(e.getOptions());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));
            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            devSetVo5.add(devSetVo);
        });
        appDataV5.setItems(devSetVo5);

        ArrayList<DevSetVo> devSetVo6 = new ArrayList<>();
        devDictionariesList.stream().filter(devDictionaries11 -> {
            if (!StringUtils.isEmpty(devDictionaries11.getClassify())) {
                return devDictionaries11.getClassify().equals("6");
            }
            return false;
        }).collect(Collectors.toList()).forEach(e -> {
            DevSetVo devSetVo = new DevSetVo();
            devSetVo.setCode(e.getCode());
            devSetVo.setValue(e.getValue());
            devSetVo.setUnit(e.getUnit());
            devSetVo.setType(e.getDataType() + "");
            devSetVo.setName(e.getName());
            devSetVo.setOptions(e.getOptions());
            devSetVo.setRelevanceTable(e.getRelevanceTable());
            devSetVo.setShow(e.getState().equals("1"));
            devSetVo.setSubTitle(e.getDescription());
            devSetVo.setDesc(e.getDesc());
            devSetVo6.add(devSetVo);
        });
//        appDataV6.setItems(devSetVo6);
//
        ArrayList<AppDataVo> appDataVos = new ArrayList<>();
        appDataVos.add(appDataVo);
//        appDataVos.add(appDataV1);


        appDataVos.add(appDataV2);
//
//        appDataVos.add(appDataV3);
//        appDataVos.add(appDataV4);
//        appDataVos.add(appDataV5);
//        appDataVos.add(appDataV6);
        return appDataVos;

    }




    public static Map<String, String> getGlobalData() {
        return globalData;
    }

//    public static ArrayList<DevDictionaries> getDevDictionaries() {
//        return devDictionaries;
//    }
    public void loadDataOld() {
        List<ConfigInfo> configInfos = configInfoService.getBaseMapper().selectList(null);
        Map<String, String> collect = configInfos.stream().collect(Collectors.toMap(ConfigInfo::getName, ConfigInfo::getValue));
        globalData = collect;
        ArrayList<HashMap<String, String>> hashMaps = new ArrayList<>();
        HashMap<String,String>   stringStringHashMap = new HashMap<>();
        HashMap<String, String> stringStringHashMap1=new HashMap<>();
        String set="install";

        //AI
        DevDictionaries devDictionariesAI = new DevDictionaries();
        devDictionariesAI.setName("AI Mode");
        devDictionariesAI.setCode("AI");
        devDictionariesAI.setDescription("available starting Jan 2025");
        devDictionariesAI.setDataType(0);
        devDictionariesAI.setRelevanceTable("dev_info_msg1");
        devDictionariesAI.setClassify(0 + "");
        devDictionariesAI.setOpe(false);
        devDictionariesOld.add(devDictionariesAI);


        //静音开关
        DevDictionaries devDictionaries3 = new DevDictionaries();
        devDictionaries3.setName("Mute Beep");
        devDictionaries3.setCode("BZ");
        devDictionaries3.setRelevanceTable("dev_info_msg1");
        devDictionaries3.setDataType(0);
        devDictionaries3.setClassify(0 + "");
//        devDictionaries3.setDescription(set+"28");
        devDictionariesOld.add(devDictionaries3);

        //41 快速关断功能设置
        DevDictionaries devDictionaries5 = new DevDictionaries();
        devDictionaries5.setName("Rapid Shutdown Function");
        devDictionaries5.setCode("RAPIDEN");
        devDictionaries5.setRelevanceTable("dev_info_msg1");
        devDictionaries5.setDataType(0);
        devDictionaries5.setClassify(0 + "");
//        devDictionaries5.setDescription(set+"41");
        devDictionariesOld.add(devDictionaries5);

        //输出电压  01指令
        DevDictionaries devDictionaries10 = new DevDictionaries();
        devDictionaries10.setName("01 Output voltage");
        devDictionaries10.setCode("VO");
        devDictionaries10.setDataType(1);
        devDictionaries10.setRelevanceTable("dev_info_msg1");
        devDictionaries10.setClassify(2 + "");
        devDictionaries10.setState("1");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("label", "110V");
        stringStringHashMap.put("value", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("label", "120V");
        stringStringHashMap.put("value", "1100");
        stringStringHashMap.put("", "");
        hashMaps.add(stringStringHashMap);
        devDictionaries10.setOptions(hashMaps);
        devDictionariesOld.add(devDictionaries10);


        //输出频率 02指令
        DevDictionaries devDictionaries11 = new DevDictionaries();
        devDictionaries11.setName("02 Output Frenquency");
        devDictionaries11.setCode("FO");
        devDictionaries11.setDataType(1);
        devDictionaries11.setRelevanceTable("dev_info_msg1");
        devDictionaries11.setClassify(2 + "");
        devDictionaries11.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50HZ", "50");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60HZ", "60");
        hashMaps.add(stringStringHashMap);
        devDictionaries11.setOptions(hashMaps);


        devDictionariesOld.add(devDictionaries11);


        DevDictionaries devDictionariesBT = new DevDictionaries();
        devDictionariesBT.setName("03 Battery Type");
        devDictionariesBT.setCode("BT");
        devDictionariesBT.setDataType(1);
        devDictionariesBT.setRelevanceTable("dev_info_msg1");
        devDictionariesBT.setClassify(2 + "");
        devDictionariesBT.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("User-Defined(default)(USE)", "0");
//        stringStringHashMap.put("desc","If “User Defined” is selected, battery charge voltage and low DC cut off voltage can be set up in program 4, 7, 8and 9.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Pylontech Battery", "1");
//        stringStringHashMap.put("desc","If “If selected, programs of 4, 7, 8 and 9 will be automatically set up. No need for further setting.");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("WECO Battery", "3");
//        stringStringHashMap.put("desc","If selected, programs of 4, 7, 8 and9 will be auto configured per battery supplier recommended. No need for further adjustment.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Soltaro Batter", "4");
//        stringStringHashMap.put("desc","If selected, programs of 4, 7, 8 and9 will be auto configured per battery supplier recommended. No need for further adjustment.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("LIb-protocol Compatible Battery", "6");
//        stringStringHashMap.put("desc","Select “LIb” if using Lithium battery compatible to Lib protocol. If selected, programs of4, 7, 8and 9 will be automatically set up. No need for further setting.");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Party Lithium Battery", "7");
//        stringStringHashMap.put("desc","If selected, programs of 4, 7, 8 and 9 will be automatically set up. No need for further setting. Please contact the battery supplier for installation procedure.");

        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("VSC", "8");
//        stringStringHashMap.put("desc","If selected, standard CAN protocol will be supported.");
        hashMaps.add(stringStringHashMap);
        devDictionariesBT.setOptions(hashMaps);


        devDictionariesOld.add(devDictionariesBT);


        //最大AC充电电流
        DevDictionaries devDictionariesMCC = new DevDictionaries();
        devDictionariesMCC.setName("04 Max Charge Current (PV + Grid)");
        devDictionariesMCC.setCode("MCC");
        devDictionariesMCC.setDataType(6);
        devDictionariesMCC.setRelevanceTable("dev_info_msg1");
        devDictionariesMCC.setDescription("pv+Grid");
//        devDictionariesMCC.setDesc("Setting range is 1A, then from 10A to 120A.Increment of each click is 10A.");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("10A", "0100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("20A", "0200");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("30A", "0300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("40A", "0400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A", "0500");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("70A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("80A", "0800");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("90A", "0900");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("100A", "1000");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110A", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120A", "1200");
        hashMaps.add(stringStringHashMap);


        devDictionariesMCC.setOptions(hashMaps);
        devDictionariesMCC.setClassify(2 + "");


        devDictionariesOld.add(devDictionariesMCC);

        //最大AC充电电流
        DevDictionaries devDictionaries21 = new DevDictionaries();
        devDictionaries21.setName("05 Max AC Charge Current");
        devDictionaries21.setCode("MCG");
        devDictionaries21.setDataType(6);
        devDictionaries21.setRelevanceTable("dev_info_msg1");
//        devDictionaries21.setDesc("Setting range is from 10A to 120A. Increment of each click is 10A.");
//        devDictionariesMCC.setDescription("pv+Grid");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("10A", "0100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("20A", "0200");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("30A", "0300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("40A", "0400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A", "0500");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("70A", "0700");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("80A", "0800");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("90A", "0900");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("100A", "1000");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110A", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120A", "1200");
        hashMaps.add(stringStringHashMap);


        devDictionaries21.setOptions(hashMaps);
        devDictionaries21.setClassify(2 + "");

        devDictionariesOld.add(devDictionaries21);


        //        hybrid模式下电池最大放电电流
        DevDictionaries devDictionariesMDH = new DevDictionaries();
        devDictionariesMDH.setName("06 Maximum discharging current when grid is available");
        devDictionariesMDH.setCode("MDH");
        devDictionariesMDH.setDataType(6);
//        devDictionariesMDH.setDesc("Setting range is from 10A to 120A. Increment of each click is 10A.");
        devDictionariesMDH.setRelevanceTable("dev_info_msg1");

        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("10A", "0100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("20A", "0200");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("30A", "0300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("40A", "0400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A", "0500");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("60A", "0600");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("70A", "0700");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("80A", "0800");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("90A", "0900");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("100A", "1000");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("110A", "1100");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120A", "1200");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("130A", "1300");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("140A", "1400");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("150A", "1500");
        hashMaps.add(stringStringHashMap);

        devDictionariesMDH.setOptions(hashMaps);
        devDictionariesMDH.setClassify(2 + "");

        devDictionariesOld.add(devDictionariesMDH);


        //电池C.V电压07
        DevDictionaries devDictionariesBVM = new DevDictionaries();
        devDictionariesBVM.setName("07 Bulk charging voltage");
        devDictionariesBVM.setCode("BVM");
        devDictionariesBVM.setDataType(7);
        devDictionariesBVM.setRelevanceTable("dev_info_msg1");
        devDictionariesBVM.setClassify(2 + "");
        devDictionariesBVM.setDescription(set+"07");
        devDictionariesBVM.setUnit("V");
//        devDictionariesBVM.setDesc("Setting range is from 48.0V to 62.0V. Increment of each click is 0.1V.");
        devDictionariesBVM.setDescription("C.V voltage");
        devDictionariesOld.add(devDictionariesBVM);


        //电池浮充电压08
        DevDictionaries devDictionariesBVF = new DevDictionaries();
        devDictionariesBVF.setName("08 Floating charging voltage");
        devDictionariesBVF.setCode("BVF");
        devDictionariesBVF.setDataType(7);
        devDictionariesBVF.setUnit("V");
        devDictionariesBVF.setRelevanceTable("dev_info_msg1");
        devDictionariesBVF.setClassify(2 + "");
//        devDictionariesBVF.setDesc("Setting range is from 48.0V to 62.0V. Increment of each click is 0.1V.");

        devDictionariesOld.add(devDictionariesBVF);


        //无市电时电池放电截止SOC(有BMS时)09
        DevDictionaries devDictionariesBSOC1 = new DevDictionaries();
        devDictionariesBSOC1.setName("09 Low DC cut off battery voltage setting or battery SOC when grid is unavailable");
        devDictionariesBSOC1.setCode("BSOC1");
        devDictionariesBSOC1.setDataType(6);
        devDictionariesBSOC1.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOC1.setClassify(2 + "");
//        devDictionariesBSOC1.setDesc("Setting range is from 0% to 80%. Increment of each click is 1%.");

        hashMaps = new ArrayList<>();
        for (int i = 0; i < 17; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put(((i)*5)+"%", "0"+((i)*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOC1.setOptions(hashMaps);
        devDictionariesOld.add(devDictionariesBSOC1);



        //无市电时电池恢复放电SOC(有BMS时)10
        DevDictionaries devDictionariesBSOC2 = new DevDictionaries();
        devDictionariesBSOC2.setName("10 Battery re-discharging voltage or battery SOCwhen grid is unavailable");
        devDictionariesBSOC2.setCode("BSOC2");
        devDictionariesBSOC2.setDataType(6);
        devDictionariesBSOC2.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOC2.setClassify(2 + "");

//        devDictionariesBSOC2.setDesc("Setting range is from 0% to 80%. Increment of each click is 1%.");
        hashMaps = new ArrayList<>();
        for (int i = 0; i < 17; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put(((i)*5)+"%", "0"+((i)*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOC2.setOptions(hashMaps);
        devDictionariesOld.add(devDictionariesBSOC2);


        //无市电时电池放电截止SOC(有BMS时)11
        DevDictionaries devDictionariesBSOCG1 = new DevDictionaries();
        devDictionariesBSOCG1.setName("11 BMS(SOC)");
        devDictionariesBSOCG1.setCode("BSOCG1");
        devDictionariesBSOCG1.setDataType(6);
        devDictionariesBSOCG1.setRelevanceTable("dev_info_msg1");
//        devDictionariesBSOCG1.setDesc("Setting range is from 5% to 95%. Increment of each click is 1%.");
        devDictionariesBSOCG1.setClassify(2 + "");

        hashMaps = new ArrayList<>();
        for (int i = 1; i < 20; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put((i*5)+"%","0"+(i*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOCG1.setOptions(hashMaps);
        devDictionariesOld.add(devDictionariesBSOCG1);


        //无市电时电池恢复放电SOC(有BMS时)12
        DevDictionaries devDictionariesBSOCG2 = new DevDictionaries();
        devDictionariesBSOCG2.setName("12 Battery re-discharging voltage or battery SOCwhen grid is available");
        devDictionariesBSOCG2.setCode("BSOCG2");
        devDictionariesBSOCG2.setDataType(6);
        devDictionariesBSOCG2.setRelevanceTable("dev_info_msg1");
        devDictionariesBSOCG2.setClassify(2 + "");
//        devDictionariesBSOCG1.setDesc("Setting range is from 5% to 95%. Increment of each click is 1%.");
        hashMaps = new ArrayList<>();
        for (int i = 1; i < 20; i++) {
            stringStringHashMap = new HashMap<>();
            stringStringHashMap.put((i*5)+"%", "0"+(i*5)+"");
            hashMaps.add(stringStringHashMap);
        }
        devDictionariesBSOCG2.setOptions(hashMaps);
        devDictionariesOld.add(devDictionariesBSOCG2);



        //solar能量分配优先级
        DevDictionaries devDictionaries18 = new DevDictionaries();
        devDictionaries18.setName("14 Solar Priority");
        devDictionaries18.setCode("SP");
        devDictionaries18.setDataType(1);
        devDictionaries18.setRelevanceTable("dev_info_msg1");
        devDictionaries18.setClassify(2 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Battery-Load-Grid", "00");
//        stringStringHashMap.put("desc","PV power will charge battery first, then provide power to the load. If there is any remaining power left, it will feed-in to the grid");
        hashMaps.add(stringStringHashMap);


        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Load-Battery-Grid", "01");
//        stringStringHashMap.put("desc","PV power will charge battery first, then provide power to the load. If there is any remaining power left, it will feed-in to the grid");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Load-Grid-Battery", "02");
//        stringStringHashMap.put("desc","PV power will provide power to the load first. If there is more PV power available, it will feed-in to the grid. If feed-in power reaches max. feed-in power setting, the remaining power will charge battery");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Grid-tie with backup", "03");
        hashMaps.add(stringStringHashMap);
//        stringStringHashMap.put("desc","If selected, it is only allowed to set up peak time and off peak for electricity demand. Programs of 15, 17, 18, 19 and 20 can’t be set and only programs of 21, 22, 23 and 24 can be set.");
        devDictionaries18.setOptions(hashMaps);

//        devDictionaries18.setDescription(set+"14");
        devDictionariesOld.add(devDictionaries18);


        //充电源
        DevDictionaries devDictionaries20 = new DevDictionaries();
        devDictionaries20.setName("15 Charge Source");
        devDictionaries20.setCode("PCE");
        devDictionaries20.setDataType(1);
        devDictionaries20.setRelevanceTable("dev_info_msg1");
        devDictionaries20.setClassify(2 + "");
        devDictionaries20.setState("1");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Solar and Utility(default)", "0");
//        stringStringHashMap.put("desc","If there is remaining PV power after supporting the loads, it will charge battery first. Only until PV power is not available, grid will charge battery.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Only Solar", "1");
//        stringStringHashMap.put("desc","It is only allow PV power to charge battery.");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("None", "2");
        hashMaps.add(stringStringHashMap);
//        stringStringHashMap.put("desc","It is not allowed to charge battery no matter it’s PV power or grid.");
        devDictionaries20.setOptions(hashMaps);
//        devDictionaries20.setDescription(set+"15");
        devDictionariesOld.add(devDictionaries20);


        //并网控制
        DevDictionaries devDictionaries7 = new DevDictionaries();
        devDictionaries7.setName("16 Feed to Grid (PV)");
        devDictionaries7.setCode("FE");
        devDictionaries7.setRelevanceTable("dev_info_msg1");
        devDictionaries7.setDataType(0);
        devDictionaries7.setClassify(2 + "");
        devDictionaries7.setState(1 + "");
//        devDictionaries7.setDescription(set+ "16");
        devDictionariesOld.add(devDictionaries7);

        //电池并网控制（太阳能接入）
        DevDictionaries devDictionaries8 = new DevDictionaries();
        devDictionaries8.setName("17 Battery Feed to Grid (PV Available)");
        devDictionaries8.setCode("BFE1");
        devDictionaries8.setRelevanceTable("dev_info_msg1");
        devDictionaries8.setDataType(0);
        devDictionaries8.setClassify(2 + "");
        devDictionaries8.setState(1 + "");
//        devDictionaries8.setDescription(set+"17");
        devDictionariesOld.add(devDictionaries8);

        //电池并网控制（太阳能未接）
        DevDictionaries devDictionaries9 = new DevDictionaries();
        devDictionaries9.setName("18 Battery Feed to Grid (PV Unavailable)");
        devDictionaries9.setCode("BFE2");
        devDictionaries9.setRelevanceTable("dev_info_msg1");
        devDictionaries9.setDataType(0);
        devDictionaries9.setClassify(2 + "");
        devDictionaries9.setState(1 + "");
//        devDictionaries9.setDescription(set+"18");
        devDictionariesOld.add(devDictionaries9);

        //PV正常时输出优先级
        DevDictionaries devDictionaries14 = new DevDictionaries();
        devDictionaries14.setName("19 Output priority when the PV is normal");
        devDictionaries14.setCode("PDE1");
        devDictionaries14.setDataType(1);
        devDictionaries14.setRelevanceTable("dev_info_msg1");
        devDictionaries14.setClassify(2+"");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Solar-Grid-Battery", "0");
//        stringStringHashMap.put("desc","PV power will provide power to the load first. If it’s not sufficient, grid will provide power to the load. If grid is not available at the same time, battery power will back up.");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Solar-Battery-Grid", "1");
//        stringStringHashMap.put("desc","PV power will provide power to the load first. If it’s not sufficient, battery power will provide power to the load");
        hashMaps.add(stringStringHashMap);
        devDictionaries14.setOptions(hashMaps);
//        devDictionaries14.setDescription(set+"19");
        devDictionariesOld.add(devDictionaries14);


        //PV异常时输出优先级
        DevDictionaries devDictionaries15 = new DevDictionaries();
        devDictionaries15.setName("20 Output priority when the PV is abnormal");
        devDictionaries15.setCode("PDE2");
        devDictionaries15.setDataType(1);
        devDictionaries15.setRelevanceTable("dev_info_msg1");
        devDictionaries15.setClassify(2 + "");
        devDictionaries15.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Grid-Battery", "0");

//        stringStringHashMap.put("desc","Grid will provide power to the load at first. If grid is not available, battery power will provide power backup.");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
//        stringStringHashMap.put("desc","Battery power will provide power to the load at first. If battery power is running out, grid will back up the load. This setting is ineffective during of AC charging.");
        stringStringHashMap.put("Battery-Grid", "1");
        hashMaps.add(stringStringHashMap);
        devDictionaries15.setOptions(hashMaps);
//        devDictionaries15.setDescription(set+"20");
        devDictionariesOld.add(devDictionaries15);


        //21 AC开始充电时间1
        DevDictionaries devDictionaries22 = new DevDictionaries();
        devDictionaries22.setName("21 Start time AC Charging 1");
        devDictionaries22.setCode("TS1");
        devDictionaries22.setDataType(3);
        devDictionaries22.setRelevanceTable("dev_info_msg1");
        devDictionaries22.setClassify(0 + "");
        devDictionaries22.setOperation("x/100");
//        devDictionaries22.setDescription(set+"21");
        devDictionariesOld.add(devDictionaries22);

        //22 AC结束充电时间1
        DevDictionaries devDictionaries23 = new DevDictionaries();
        devDictionaries23.setName("22 End time AC Charging 1");
        devDictionaries23.setCode("TE1");
        devDictionaries23.setDataType(3);
        devDictionaries23.setRelevanceTable("dev_info_msg1");
        devDictionaries23.setClassify(0 + "");
        devDictionaries23.setOperation("x/100");
//        devDictionaries23.setDescription(set+"22");
        devDictionariesOld.add(devDictionaries23);

        //23 AC开始充电时间2
        DevDictionaries devDictionaries24 = new DevDictionaries();
        devDictionaries24.setName("23 Start time AC Charging 2");
        devDictionaries24.setCode("TS2");
        devDictionaries24.setDataType(3);
        devDictionaries24.setRelevanceTable("dev_info_msg1");
        devDictionaries24.setClassify(0 + "");
        devDictionaries24.setOperation("x/100");
//        devDictionaries24.setDescription(set+"23");
        devDictionariesOld.add(devDictionaries24);

        //24 AC结束充电时间2
        DevDictionaries devDictionaries25 = new DevDictionaries();
        devDictionaries25.setName("24 End time AC Charging 2");
        devDictionaries25.setCode("TE2");
        devDictionaries25.setDataType(3);
        devDictionaries25.setRelevanceTable("dev_info_msg1");
        devDictionaries25.setClassify(0 + "");
        devDictionaries25.setOperation("x/100");
//        devDictionaries25.setDescription(set+"24");
        devDictionariesOld.add(devDictionaries25);


        //AC带载开启时间
        DevDictionaries devDictionaries16 = new DevDictionaries();
        devDictionaries16.setName("25 Start time Enable AC supply load");
        devDictionaries16.setCode("TSL");
        devDictionaries16.setDataType(3);
        devDictionaries16.setRelevanceTable("dev_info_msg1");
        devDictionaries16.setClassify(2 + "");
        devDictionaries16.setState("1");
        devDictionaries16.setOperation("x/100");
//        devDictionaries16.setDescription(set+"25");
        devDictionariesOld.add(devDictionaries16);


        //AC带载开启时间
        DevDictionaries devDictionaries17 = new DevDictionaries();
        devDictionaries17.setName("26 End time Enable AC supply load");
        devDictionaries17.setCode("TEL");
        devDictionaries17.setDataType(3);
        devDictionaries17.setRelevanceTable("dev_info_msg1");
        devDictionaries17.setClassify(2 + "");
        devDictionaries17.setState("1");
        devDictionaries17.setOperation("x/100");
//        devDictionaries17.setDescription(set+"26");
        devDictionariesOld.add(devDictionaries17);









        //锂电池
        DevDictionaries devDictionariesBBA = new DevDictionaries();
        devDictionariesBBA.setName("31 Li_Bat Active Function");
        devDictionariesBBA.setCode("BBA");
        devDictionariesBBA.setRelevanceTable("dev_info_msg1");
        devDictionariesBBA.setDataType(0);
        devDictionariesBBA.setClassify(2 + "");
//        devDictionariesBBA.setDescription(set+"31");
        devDictionariesOld.add(devDictionariesBBA);


        DevDictionaries devDictionaries13 = new DevDictionaries();
        devDictionaries13.setName("32 Output Mode");
        devDictionaries13.setCode("OM");
        devDictionaries13.setDataType(1);
        devDictionaries13.setRelevanceTable("dev_info_msg1");
        devDictionaries13.setClassify(2 + "");
        devDictionaries13.setState(1 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Single", "0");
//        stringStringHashMap.put("desc","Single: This inverter is used in single phase application (default)");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("Parallel", "1");
//        stringStringHashMap.put("desc","Parallel: This inverter is operated in parallel system");
        hashMaps.add(stringStringHashMap1);
        devDictionaries13.setOptions(hashMaps);
//        devDictionaries13.setDescription(set+"32");
        devDictionariesOld.add(devDictionaries13);


        //发电机使能 33
        DevDictionaries devDictionariesGGI = new DevDictionaries();
        devDictionariesGGI.setName("33 Generator as AC source");
        devDictionariesGGI.setCode("GGI");
        devDictionariesGGI.setDataType(0);
        devDictionariesGGI.setRelevanceTable("dev_info_msg1");
        devDictionariesGGI.setClassify(2 + "");
//        devDictionariesGGI.setDescription(set+"33");
        devDictionariesOld.add(devDictionariesGGI);

        //宽的AC输入 34
        DevDictionaries devDictionariesWGI = new DevDictionaries();
        devDictionariesWGI.setName("34 Wide AC input range");
        devDictionariesWGI.setCode("WGI");
        devDictionariesWGI.setDataType(0);
        devDictionariesWGI.setRelevanceTable("dev_info_msg1");
        devDictionariesWGI.setClassify(2 + "");
//        devDictionariesWGI.setDescription(set+"34");
        devDictionariesOld.add(devDictionariesWGI);
        //设置时间
        DevDictionaries devDictionaries26 = new DevDictionaries();
        devDictionaries26.setName("Date Setting");
        devDictionaries26.setCode("T");
        devDictionaries26.setDataType(4);
        devDictionaries26.setRelevanceTable("dev_info_msg0");
        devDictionaries26.setClassify(0 + "");
        devDictionariesOld.add(devDictionaries26);


        //设置时区
        DevDictionaries devDictionaries27 = new DevDictionaries();
        devDictionaries27.setName("Time Setting");
        devDictionaries27.setCode("T");
        devDictionaries27.setDataType(4);
        devDictionaries27.setRelevanceTable("dev_info_msg0");
        devDictionaries27.setClassify(0 + "");
        devDictionaries27.setState("1");
        devDictionariesOld.add(devDictionaries27);






        //36 外部CT功能
        DevDictionaries devDictionaries4 = new DevDictionaries();
        devDictionaries4.setCode("ECTS");
        devDictionaries4.setName("External CT function");
        devDictionaries4.setRelevanceTable("dev_info_msg1");
        devDictionaries4.setDataType(1);
        devDictionaries4.setDescription("Refer to Appendix III for the details");
        devDictionaries4.setClassify(0 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Disable", "00");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A-single", "01");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("50A-parallel", "02");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("200A-single", "03");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("200A-parallel", "04");
//        stringStringHashMap.put("description","kdlsfjsdljflsjdflskfsfds");
        hashMaps.add(stringStringHashMap);
        devDictionaries4.setOptions(hashMaps);
//        devDictionaries4.setDescription(set+"36");
        devDictionariesOld.add(devDictionaries4);

        // 27 LCD休眠等待时间
        DevDictionaries devDictionaries2 = new DevDictionaries();
        devDictionaries2.setName("Screen time out");
        devDictionaries2.setCode("LST");
        devDictionaries2.setRelevanceTable("dev_info_msg1");
        devDictionaries2.setDataType(1);
        devDictionaries2.setClassify(0 + "");
        devDictionaries2.setUnit("s");
        hashMaps = new ArrayList<>();
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("30s", "01");
        hashMaps.add(stringStringHashMap1);
        HashMap<String, String> stringStringHashMap2 = new HashMap<>();
        stringStringHashMap2.put("60s", "02");
        hashMaps.add(stringStringHashMap2);
        HashMap<String, String> stringStringHashMap3 = new HashMap<>();
        stringStringHashMap3.put("300s", "10");
        hashMaps.add(stringStringHashMap3);
        HashMap<String, String> stringStringHashMap4 = new HashMap<>();
        stringStringHashMap4.put("600s", "20");
        hashMaps.add(stringStringHashMap4);
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("never", "00");
        hashMaps.add(stringStringHashMap);
        devDictionaries2.setOptions(hashMaps);
//        devDictionaries2.setDescription(set+"27");
        devDictionariesOld.add(devDictionaries2);

        //PV并联
        DevDictionaries devDictionaries19 = new DevDictionaries();
        devDictionaries19.setName("37 PV1/PV2 Paralle");
        devDictionaries19.setCode("PVP");
        devDictionaries19.setDataType(0);
        devDictionaries19.setRelevanceTable("dev_info_msg1");
        devDictionaries19.setClassify(2 + "");
//        devDictionaries19.setDescription(set+"37");
        devDictionariesOld.add(devDictionaries19);




        //发动机
        DevDictionaries devDictionariesGENP = new DevDictionaries();
        devDictionariesGENP.setName("38-39 Generator Port Function");
        devDictionariesGENP.setCode("GENP");
        devDictionariesGENP.setRelevanceTable("dev_info_msg2");
        devDictionariesGENP.setDataType(1);
        devDictionariesGENP.setClassify(2 + "");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Disable", "0");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("Generator", "2");
        hashMaps.add(stringStringHashMap);

        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("AC Coupling", "3");
        hashMaps.add(stringStringHashMap);
        devDictionariesGENP.setOptions(hashMaps);
//        devDictionariesGENP.setDescription(set+"38-39");
        devDictionariesOld.add(devDictionariesGENP);





//        hashMaps = new ArrayList<>();





        //输出相角
        DevDictionaries devDictionaries12 = new DevDictionaries();
        devDictionaries12.setName("40 Output Phase Angle");
        devDictionaries12.setCode("OPANG");
        devDictionaries12.setDataType(1);
        devDictionaries12.setRelevanceTable("dev_info_msg1");
        devDictionaries12.setClassify(2 + "");
        devDictionaries12.setState("1");
        hashMaps = new ArrayList<>();
        stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("120°", "1");
        hashMaps.add(stringStringHashMap);
        stringStringHashMap1 = new HashMap<>();
        stringStringHashMap1.put("180°", "2");
        hashMaps.add(stringStringHashMap1);
        devDictionaries12.setOptions(hashMaps);
//        devDictionaries12.setDescription(set+"40");
        devDictionariesOld.add(devDictionaries12);





        //电网法规
        DevDictionaries devDictionaries6 = new DevDictionaries();
        devDictionaries6.setName("Grid Standard");
        devDictionaries6.setCode("RL");
        devDictionaries6.setRelevanceTable("dev_info_msg1");
        devDictionaries6.setDataType(1);
        hashMaps = new ArrayList<>();
        devDictionaries6.setState(0 + "");
        devDictionariesOld.add(devDictionaries6);

        //LOG交流输出控制
        DevDictionaries devDictionariesLOG = new DevDictionaries();
        devDictionariesLOG.setName("Ac output control");
        devDictionariesLOG.setCode("LOG");
        devDictionariesLOG.setDataType(0);
        devDictionariesLOG.setRelevanceTable("dev_info_msg1");
        devDictionariesLOG.setClassify(2 + "");
        devDictionariesLOG.setDescription("Ac output control");
        devDictionariesOld.add(devDictionariesLOG);



//        devDictionaries27.setOpe(false);


        //恢复出厂设置
        DevDictionaries devDictionaries30 = new DevDictionaries();
        devDictionaries30.setName("Factory data reset");
        devDictionaries30.setCode("FR");
        devDictionaries30.setDataType(2);
        devDictionaries30.setRelevanceTable("dev_info_msg0");
        devDictionaries30.setClassify(6 + "");
        devDictionaries30.setState("1");

        //固件升级
        DevDictionaries devDictionaries29 = new DevDictionaries();
        devDictionaries29.setName("DSP Firmware Version");
        devDictionaries29.setCode("OTA");
        devDictionaries29.setDataType(5);
        devDictionaries29.setRelevanceTable("dev_info_msg3");
        devDictionaries29.setClassify(1 + "");
        devDictionaries29.setState("1");
        devDictionariesOld.add(devDictionaries29);

        DevDictionaries devDictionaries32 = new DevDictionaries();
        devDictionaries32.setName("DSP update firmware");
        devDictionaries32.setCode("FWV1");
        devDictionaries32.setDataType(5);
        devDictionaries32.setRelevanceTable("dev_info_msg3");
        devDictionaries32.setClassify(1 + "");
        devDictionaries32.setState("0");
        devDictionariesOld.add(devDictionaries32);

        DevDictionaries devDictionaries33 = new DevDictionaries();
        devDictionaries33.setName("DSP update firmware");
        devDictionaries33.setCode("FWV3");
        devDictionaries33.setDataType(5);
        devDictionaries33.setRelevanceTable("dev_info_msg3");
        devDictionaries33.setClassify(1 + "");
        devDictionaries33.setState("0");
        devDictionariesOld.add(devDictionaries33);
//        devDictionaries29.setOpe(false);

        DevDictionaries devDictionaries31 = new DevDictionaries();
        devDictionaries31.setName("Remote Frimware Version");
        devDictionaries31.setCode("OTA9");
        devDictionaries31.setDataType(5);
        devDictionaries31.setRelevanceTable("dev_info_msg3");
        devDictionaries31.setClassify(1 + "");
        devDictionaries31.setState("1");
        devDictionaries31.setOpe(false);
        devDictionariesOld.add(devDictionaries31);

        //恢复出厂设置
        DevDictionaries devDictionaries28 = new DevDictionaries();
        devDictionaries28.setName("factory data reset");
        devDictionaries28.setCode("T");
        devDictionaries28.setDataType(5);
        devDictionaries28.setRelevanceTable("dev_info_msg0");
        devDictionaries28.setClassify(6 + "");
        devDictionaries28.setState("1");
        devDictionariesOld.add(devDictionaries28);
    }
}
